Car myCar;
void setup(){
  size(500,500);
  colorMode(RGB, 100);
  myCar = new Car(1,1);
}

void draw(){
  background(100);
  myCar.drive();
  myCar.draw();
}

class Car{
  int x, y,speedx,speedy;
  Car(int spx,int spy){
    x = y = 0;
    speedx = spx;
    speedy = spy;
  }
  void drive(){
    x += speedx;
    y += speedy;
    if( x>width || y >height)
    {
      x = y = 0;
    }
  }
  void draw(){
    rectMode(CENTER);
    rect(x,y,20,100);
    ellipse(x,y-30,60,60);
    ellipse(x-19,y-30,16,32);
    ellipse(x+19,y-30,16,32);
    line(x-10,y+50,x-20,y+60);
    line(x+10,y+50,x+20,y+60);
  }
}
